/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author George
 */
@Entity
@Table(name = "DETALLE_SALIDA", catalog = "BDACCELCOM", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DetalleSalida.findAll", query = "SELECT d FROM DetalleSalida d"),
    @NamedQuery(name = "DetalleSalida.findByIdDetSalida", query = "SELECT d FROM DetalleSalida d WHERE d.idDetSalida = :idDetSalida"),
    @NamedQuery(name = "DetalleSalida.findByCantidad", query = "SELECT d FROM DetalleSalida d WHERE d.cantidad = :cantidad"),
    @NamedQuery(name = "DetalleSalida.findByPrecioVenta", query = "SELECT d FROM DetalleSalida d WHERE d.precioVenta = :precioVenta")})
public class DetalleSalida implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "IdDetSalida")
    private Integer idDetSalida;
    @Column(name = "Cantidad")
    private Integer cantidad;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "PrecioVenta")
    private BigDecimal precioVenta;
    @JoinColumn(name = "NroSalida", referencedColumnName = "NroSalida")
    @ManyToOne(optional = false)
    private SalidaAlmacen nroSalida;
    @JoinColumn(name = "IdProducto", referencedColumnName = "IdProducto")
    @ManyToOne(optional = false)
    private Producto idProducto;

    public DetalleSalida() {
    }

    public DetalleSalida(Integer idDetSalida) {
        this.idDetSalida = idDetSalida;
    }

    public Integer getIdDetSalida() {
        return idDetSalida;
    }

    public void setIdDetSalida(Integer idDetSalida) {
        this.idDetSalida = idDetSalida;
    }

    public Integer getCantidad() {
        return cantidad;
    }

    public void setCantidad(Integer cantidad) {
        this.cantidad = cantidad;
    }

    public BigDecimal getPrecioVenta() {
        return precioVenta;
    }

    public void setPrecioVenta(BigDecimal precioVenta) {
        this.precioVenta = precioVenta;
    }

    public SalidaAlmacen getNroSalida() {
        return nroSalida;
    }

    public void setNroSalida(SalidaAlmacen nroSalida) {
        this.nroSalida = nroSalida;
    }

    public Producto getIdProducto() {
        return idProducto;
    }

    public void setIdProducto(Producto idProducto) {
        this.idProducto = idProducto;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDetSalida != null ? idDetSalida.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetalleSalida)) {
            return false;
        }
        DetalleSalida other = (DetalleSalida) object;
        if ((this.idDetSalida == null && other.idDetSalida != null) || (this.idDetSalida != null && !this.idDetSalida.equals(other.idDetSalida))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.DetalleSalida[ idDetSalida=" + idDetSalida + " ]";
    }
    
}
